fix(cmdScan): replace filepath.Glob ** with WalkDir + EM state run 11 β closes #52#96
Merged
fix(cmdScan): replace filepath.Glob ** with WalkDir + EM state run 11 β closes #52#96
Conversation
closes #52 - filepath.Glob does not support ** recursive patterns in Go; goEntries was always nil (0 files) because the pattern looked for a literal dir named "**" - Replace with filepath.WalkDir to collect .go files recursively under internal/ - Add io/fs import required by WalkDir callback signature - EM state run 11: closed stale PR #94, P2 bug sweep 3/3 fixes now in open PRs Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Provider interface abstracts LLM backends (Ollama, Anthropic). OllamaProvider wraps existing ollama.Chat(). Agent loop accepts optional Provider in LoopConfig β nil falls back to legacy path. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements llm.Provider for Anthropic Messages API using stdlib HTTP. Handles tool_use content blocks, tool_result responses, system prompt extraction, and token tracking. Tests use httptest mock server. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When Provider returns structured ToolCalls, handle them directly: normalize β governance β execute β tool_result feedback. Bypasses text-based intent parsing. Uses []llm.Message internally when Provider is set. Ollama/legacy path unchanged. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shellforge agent --provider anthropic 'prompt' runs the agent loop against the Anthropic Messages API with native tool-use. Defaults to Ollama for backwards compatibility. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When Anthropic responds with tool_use blocks, the assistant message in conversation history must include structured tool_use content β not just plain text. Added ToolCalls field to llm.Message and reconstruct tool_use blocks in convertMessages(). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Author
Updated: Anthropic API provider + native tool-useThis PR now includes the API-driven swarm architecture work: New commits:
Verified: 13 LLM tests + 4 agent loop tests pass. Live smoke test against Haiku successful. |
ThinkingBudget field on AnthropicProvider caps thinking tokens per call. Prevents runaway output spend on complex tasks. CLI flag: --thinking-budget <tokens>. Thinking content blocks silently consumed in response parsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Every 5 tool calls, asks the model to self-score alignment with original task (1-10). Below 7 β steering message injected. Below 5 twice β task killed. Prevents agents from burning tokens on off-task work. 8 drift tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmdScan()always reporting 0 Go files βfilepath.Globdoesn't support**recursive patterns in Go (POSIX glob only), so the patterninternal/**/*.gomatched a literal dir named**which never existsfilepath.WalkDirto recursively collect.gofiles underinternal/io/fsimport required by theWalkDircallback'sfs.DirEntryparameterCode change
Test plan
go build ./cmd/shellforge/passesgo test ./...β 25/25 pass (governance, intent, normalizer)shellforge scanin the repo root now correctly reports Go file count (was 0, now non-zero)EM state
Run 11 β P2 bug sweep status:
run()errors): green, awaiting mergeπ€ Generated with Claude Code